package com.example.chengche_lol.ui.news;

import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.chengche_lol.R;
import com.example.chengche_lol.adapter.NewsCloudAdapter;
import com.example.chengche_lol.base.BaseFragment;
import com.example.chengche_lol.beans.NewsCloudBean;


public class NewsCloudFragment extends BaseFragment {

    private RecyclerView mRecyclerView;
    private NewsCloudAdapter mCloudAdapter;

    @Override
    protected int rootLayout() {
        return R.layout.fragment_news_cloud;
    }

    @Override
    protected void initView(View view) {
        mRecyclerView = view.findViewById(R.id.cloud_recyclview);
    }

    @Override
    protected void initData() {

        mCloudAdapter = new NewsCloudAdapter();

        NewsCloudBean c1 = new NewsCloudBean("【重装拉夫】4重装3龙魂2战神","初音未来",R.drawable.mikudate);
        mCloudAdapter.addData(c1);
        NewsCloudBean c2 = new NewsCloudBean("【七法龙王】7法师3龙魂3森林","乐正龙牙",R.drawable.longya);
        mCloudAdapter.addData(c2);
        NewsCloudBean c3 = new NewsCloudBean("【重装拉夫】4重装3龙魂2战神","墨清弦",R.drawable.avatar_mojie01);
        mCloudAdapter.addData(c3);
        NewsCloudBean c4 = new NewsCloudBean("【七法龙王】7法师3龙魂3森林","洛天依",R.drawable.avatar_tianyi03);
        mCloudAdapter.addData(c4);
        NewsCloudBean c5 = new NewsCloudBean("【重装拉夫】4重装3龙魂2战神","MEIKO",R.drawable.avatar_mikumeiko);
        mCloudAdapter.addData(c5);
        NewsCloudBean c6 = new NewsCloudBean("【重装拉夫】4重装3龙魂2战神","初音未来",R.drawable.mikudate);
        mCloudAdapter.addData(c6);
        NewsCloudBean c7 = new NewsCloudBean("【七法龙王】7法师3龙魂3森林","乐正龙牙",R.drawable.longya);
        mCloudAdapter.addData(c7);
        NewsCloudBean c8 = new NewsCloudBean("【重装拉夫】4重装3龙魂2战神","墨清弦",R.drawable.avatar_mojie01);
        mCloudAdapter.addData(c8);
        NewsCloudBean c9 = new NewsCloudBean("【七法龙王】7法师3龙魂3森林","洛天依",R.drawable.avatar_tianyi03);
        mCloudAdapter.addData(c9);
        NewsCloudBean c10 = new NewsCloudBean("【重装拉夫】4重装3龙魂2战神","MEIKO",R.drawable.avatar_mikumeiko);
        mCloudAdapter.addData(c10);
    }

    @Override
    protected void bindData() {
        super.bindData();
        mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        mRecyclerView.setAdapter(mCloudAdapter);
    }

    @Override
    protected void bindEvent() {

    }
}
